package com.qf.fc.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.fc.entity.Address;

public interface AddressDao extends BaseMapper<Address> {
    @Select("select * from t_address where uid=#{uid}")
    List<Address> selectByUid(@Param("uid") Integer uid);

    @Insert("insert into t_address (uid, recipient, phone, addrDetail, is_default, province, city) values (#{uid}, #{recipient}, #{phone}, #{addrDetail}, #{isDefault}, #{province}, #{city})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insert(Address address);
}
